<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" /> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
	<title>JTOON</title>
	<link href="${contextPath}/css/common/w_20120429200330.css" type="text/css" rel="stylesheet">
	<link href="${contextPath}/css/common/e_20120429200330.css" type="text/css" rel="stylesheet">
	<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-31745784-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>
<body>
	<div class="u_ts">
		<a href="${contextPath}/index">
			<img width="58" height="33" alt="JTOON" src="img/jtoon.jpg">
		</a>
		<a href="${contextPath}/index">
			<img width="39" height="33" alt="웹툰" src="http://static.naver.com/m/comic/im/lg_comic.png">
		</a>
	</div>   
	<div class="chh">
		<h1>
			<a class="iic2">${title}</a> 
		</h1>
		<div class="pl"><a class="bt5" href="${contextPath}/view?cid=${firstEpisode.cid}&eid=${firstEpisode.eid.id}&eOrder=${firstEpisode.order}">첫 회 보기</a></div>
	</div>
	
	<ul id="pageList" class="li1">
		<c:forEach items="${pageList}" var="episode">
			<li> 
				<a class="ct" href="${contextPath}/view?cid=${cid}&eid=${episode.eid.id}&eOrder=${episode.order}">
					<span class="fl2 w50">
						<span class="wn"><strong>&lt;${episode.title}&gt;</strong></span>
						
						<span class="st1"><span style="width:98.92491467576792%;" class="mask"><img alt="" src="http://static.naver.com/m/comic/im/st1_on.gif"></span></span>
		                <span class="if1 st_r">9.9</span>
					</span>
					<span class="cor">
						<span class="if1 tx2"></span> 
					</span>
				</a>
			</li>
		</c:forEach>
	</ul>

	<div class="u_pg2">
		<c:if test="${page != 1}">
			<a id="prevButton" class="u_pg2_btn" href="${contextPath}/episode?cid=${cid}&page=${page-1}">
				<span class="u_pg2_prev">이전</span>
			</a>	
		</c:if>
		<em class="u_pg2_pg">
			${start}-${end} <span class="u_pg2_total">/ ${total}</span>
		</em>  
		<c:if test="${page != totalPage}">
			<a id="nextButton" class="u_pg2_btn" href="${contextPath}/episode?cid=${cid}&page=${page+1}">
				<span class="u_pg2_next">다음</span>
			</a>
		</c:if>
	</div>

	<div class="u_ft">

		<div class="u_ftlkw" id="u_ftlkw">
			<c:choose>
				<c:when test="${isLogin}">
					<a class="u_ftlk2" href="${contextPath}/logout">로그아웃</a>
					<a class="u_ftlk2" href="${contextPath}/bookmark">책갈피</a>
				</c:when>
				<c:otherwise>
					<a class="u_ftlk2" href="${contextPath}/login">로그인</a>
					<a class="u_ftlk2" href="${contextPath}/join">회원가입</a>
					<a class="u_ftlk2" href="${contextPath}/bookmark">책갈피</a>
				</c:otherwise>
			</c:choose>
		</div>

	</div>

	<address class="u_cr">
		<span class="u_cri">&copy; <a class="u_cra u_cra_v1" href="#">JTOON Corp.</a></span>  
	</address>

</body> 
</html>